﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%
    //Html.RenderAction("getMenu", "Menu");
    Dictionary<string, string> userLogin = null;
    if (Session["Userlogin"] != null)
    {
        userLogin = (Dictionary<string, string>)Session["Userlogin"];
    }

    string UserName = string.Empty;
    Guid userID = Guid.Empty;

    if (userLogin != null)
    {
        UserName = userLogin.FirstOrDefault().Value;
        Guid.TryParse(userLogin.FirstOrDefault().Key, out userID);
    }

    if (userID != Guid.Empty) // have login
    {
        string logout = "<a href=\"#\" onclick=\"logoutClick('Master_Div_Login_ID')\">(Logout)</a>";
        Div_Login_Name.Style["display"] = "";
        Div_Login_Name.InnerHtml = "Wellcome " + UserName + logout;
    }
    else //Guest
    {
        Div_Login_Register_Text_Contain.Style["display"] = "";
    }
    
%>
<div id="Div_Login_Register_Text_Contain" runat="server" style="display: none">
<a href="#" onclick="ShowPopup('Div_Login_Popup')">Login</a>
<a href="#" onclick="ShowPopup('Div_Register_Popup')">Register</a>
</div>
<div id="Div_Login_Name" runat="server" style="display: none">
    
</div>
<div id="Div_Login_Popup" class="Div_Login_Popup" style="left: 463px; position: absolute; top: 1411.5px; z-index: 9999;
    opacity: 1; display: none;">
    <span id="spanClose" class="button b-close"><span>X</span> </span>
     <% Html.RenderPartial("UC_LoginForm"); %>
</div>
<div id="Div_Register_Popup" class="Div_Login_Popup" style="left: 463px; position: absolute; top: 1411.5px; z-index: 9999;
    opacity: 1; display: none;">
    <span id="spanCloseRegister" class="button b-close"><span>X</span> </span>
     <% Html.RenderPartial("UC_RegisterForm"); %>
</div>
